<?php
namespace app\work\logic;
use app\work\validate\WorkRecordAccount as WorkRecordAccountDataValidate;

class AccountLogic extends BaseLogic {

    /**
     * 检查新增日记账规则
     * @param $department
     * @param $params
     * @return mixed
     */
    public function check_add_account_rule($department,$params){
        $validate = new WorkRecordAccountDataValidate();
        $r = $validate->scene('add')->check($params);
        if(!$r){
            return $this->get_response(0,$validate->getError());
        }

        if(empty($department)){
            return $this->get_response(0,'您没有部门，不能提交');
        }

        return $this->get_response(1,'OK');
    }
}